From: Aidan Hobson Sayers Date: Sat, 3 Feb 2018 21:24:22 +0000 (+0000) Subject: Clearer desired behaviour with an assertion X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~3^2~12^2~2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=b9c7f98ce9d3e866f0fc5d05e7208e548497c636;p=cargo.git Clearer desired behaviour with an assertion --- diff --git a/src/cargo/core/resolver/mod.rs b/src/cargo/core/resolver/mod.rs index 3522df18b..24dab3646 100644 --- a/src/cargo/core/resolver/mod.rs +++ b/src/cargo/core/resolver/mod.rs @@ -767,8 +767,11 @@ fn find_candidate<'a>(backtrack_stack: &mut Vec>, (frame.remaining_candidates.next(prev_active), frame.remaining_candidates.clone().next(prev_active).is_some()) }; + let cur_num_dep_prev_active = frame.context_backup.prev_active(dep).len(); + // Activations should monotonically decrease during backtracking + assert!(cur_num_dep_prev_active <= num_dep_prev_active); let maychange = !frame.context_backup.is_active(parent) || - frame.context_backup.prev_active(dep).len() != num_dep_prev_active; + cur_num_dep_prev_active != num_dep_prev_active; if !maychange { continue }